#ifndef SERVERTCP_H
#define SERVERTCP_H

#include <QtNetwork>

class servertcp : public QObject
{
    Q_OBJECT
public:
    explicit servertcp(QObject *parent = 0);

signals:
    void receive(const QString& msg);

public slots:
    void readMessage();
    void setPort(const qint16& port);
    void setAddress(const QString& address);

private slots:
    void newConnect();

private:
    QTcpServer tcpServer;
    QTcpSocket* tcpSocket;
    qint16 tcpPort;
    QString clientAddress;
    QString message;
};

#endif // SERVERTCP_H
